class Solution {
public:
    string largestNumber(vector<int>& nums) {
        vector<string> vs;
        for (auto x : nums)
            vs.push_back(to_string(x));

        sort(vs.begin(), vs.end(), [](string s1, string s2) {return s1 + s2 > s2 + s1; });

        string ret;
        for (auto str : vs)
            ret += str;

        if (ret[0] == '0')
            return "0";
        return ret;
    }
};